package com.bookstore.utils;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016102400753220";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCW7hOkvHlzaQnuBVUhFh0MDFm3+8O3inWicxGHTbdTFKwiLMD3LCNStTEyW9pJtxjg0qXrWH67h9mIjGiuv/B/WiFs0oEofcZ05Q0lER5F5J9n/zxpkm9h2OyYVbUkUa9VTOArDppV9OlhrMLvhR26Y8P3H3AmPNCKQYSxIp78FIXPHW+rnkb2YGDSCAoUhz8nmVMwej6TsiJ0WwDiBbEDt5Jda/+VhQ1vtGwc+jqQQzOlnTvDDIj8Nyc3+onnVQZtxPYE7OrFM3tUavFnTnBE0NK9TRSAA+ZNstw8Sl9icxm+XOgBNYm/Rh8mB9ai0UpAo+ChMVQ5WQizbofXo0nFAgMBAAECggEAM38t8qJgKhGn0q+9GRnrdUXtgsoDQGectX3feDP7HfzKsqpkeLF1p+2syIrwkwBHG8aj2AYMz72NanrF6QISc9Fz4CZ+7SrlANN6RbBujNhxz1EV8suE93TFXUC5GphIY6lkPyyvWi7DRpFkvcbEmukZXwM6B8HuQY4TUUEHz+hEAAbX6nqL6E6XvpwVfZTux08reDtYodWftgywCsblTXOAcd9LuUpGtb2wTMzCfwFL8iGDO72mauxgb6LBR+psULM5dWURs0bE1/M7Dq6nMkRzV82dKYUR3EVsEdGMHszXdgIrNQfL1nOelPCY36GBcuxtRehtmXI4jK75KpjvrQKBgQDu8Z9YbpAyT1RDVPH5z5Xh9/WSMmAFP2Wh8AwYWrsBFm6f7CscM+wLc+1sb8DCrmr4W9cU9fq1kNL/bPGaBK5slokjG72kwgLqY7UQT5ed5WSFebVGcWq2yMVAFhsgqmkA0W1Y8asLNVv6YRCREQJKungdXqLD+zxyEoA9Senj/wKBgQChtB6TmZOWtY7s2mHLVIrTu4p9U8vt3sENkO5uQ7weOrDGU7gj9J6Pbfi7Bp0c2K1BJRlmopALNoNQbHfUBgHU2E29LK3S/EIL8jt12BNCJTkQEaHYfC5JXba7vojABpl5toCb4XjgZc/wB/vAEOH0uScOHjA7wQzeoR6VLgxCOwKBgQCRNAATa0zxZcfdCvfpST7aDScMatRzG+2VFR0kh65woMMlKA2im+Lrqs0zQk4vgHK87oKr2Dc8sv+l/PxtDj84+dnonekHAGdpLKJRgSyv5UDK5AVHA5FH9oX3xfdCSIx61MnQbTv2Gb0FUIsSvPVZmCt6HZJn6nr3D0si85HQ3QKBgEUG5qaLQH1tM33YGzb49+o6fHvTcZIxLKfl3mIjeAJPe3at9kUi/yyq/SqZQCg4Nn1AoP83FdYzhwqlwuE3T0DUtRq0H9+Y33jKBqfffRkXWqyJWlVXbUrUPlUWmLmgF5PlXDEuprLjw0froIP0sQAOqaVVLbHUTvIaRTvZVFJRAoGAYLwfw+E/nUy8fg7wTVhcDPLo05IjQZjHE4vbUbMaYeKThv6TKKH//39dTaBZyLxP0iEg6Vfy9Od1Ljh2Ys//Dp6CLQuAn7Lvrs0EvDsV3A1kv9XpyI6ev2nYOq50w0gjsIkRkcnEJSjHEizy09DhfuzRu0NgfQBDEYtkAxmLEyA=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuWhBE8H+KyHGv6v7rQMCVa93ncehCzJCrSxz+ygdJgXFRd5VXiioq535HVPBvFXS8klPb+4hTtPvZt0ZoCn7Um4j/mOHgIm8bq7bP6UwK9sAdZ15rMiIrgjUBXMgLqRRBT1VVSYVKmWq/yw4ygaYlEYFJRRzilCXhmG+ITKJN7U3WwfMAiiCX5IdJwmXVgkus2dKxTYs9xNsqtdTOIVkBqYswKiyj6NehHNXw7v64Fu0e/tvMKzGKN76No6wUNffp0dTmTB6/F7w13TEcaaPbRgWO/d3NVdcSlFL4NLXUQ670t77HPFjsKSl3PSSh33kn4OEG4qNKZdSo2Zvbg2zgwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/bookstore_war/client/order/paysuccess";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
